<!-- Author:Rain -->
<template>
    <h1 style="transform: scale(2);">
        账号:<input  v-model="form.username" type="text"><br>
        密码:<input type="password" v-model="form.password"><br>
        <button @click="doLogin">进行登录！！！</button>
    </h1>
</template>

<script setup lang="ts">
import {ref, toRaw} from "vue"
import axios from "axios";
const form=ref({
    username:"",
    password:""
})
function doLogin(){
    // axios.get("http://localhost:3000/routes?id=1000").then(val=>{
    //     let {data}=val
    //     console.log(data);
        
    // }).catch(err=>{
    //     console.log(err);
        
    // })
    let data=new FormData()
    data.append("username",form.value.username)
    data.append("password",form.value.password)
        
    axios({
        url:"http://localhost:3000/login",
        method:'post',
        data
    }).then(val=>{
        console.log(val);
        
    }).catch(err=>{
        console.log(err);
        
    })
}
</script>

<style scoped>

</style>